<template>
    <div>
        <van-list v-model="loading" :finished="finished" finished-text="没有更多了" @load="onLoad">
            <div v-for="(item,index) in list" :key="index" class="van-cell flexbox spacebetween">
                <div>
                    <p class="colorO bolds">- {{item.d_money_dollar}}</p>
                    <p class="van-cell__label">{{item.d_update_time}}</p>
                </div>
                <div>
                    <p class="van-cell__value" :style="{'color': item.d_status == 1 ? 'rgb(7, 193, 96)' : item.d_status == 2 ? '#1989fa' : '#f44'}">{{item.d_status == 1 ? '审核中' : item.d_status == 2 ? '审核成功' : '审核失败'}}</p>
                    <p class="van-cell__label">提现到 <span class="bolds">{{item.d_type == 1 ? '支付宝' : '银行卡' }}</span></p>
                </div>
                
            </div>
        </van-list>
    </div>
</template>
<script>

    import '@/assets/css/main.css'
    export default {
        data(){
            return{
                list: [],
                loading: false,
                finished: false,
                page: 0,
            }
        },
        methods: {
            onLoad() {

                var _this = this;

                this.$httpGet('/api/index/Personal_center/getUserRecord',{
                    'page': ++this.page,
                    'u_id': window.localStorage.u_id,
                    'type': 3,
                }).then(response => {
                    
                    if(response.code == 200){

                        let re = response.msg.data;
                        if (re.length !== 0) {
                            //新增数据拼接在后面
                            this.list = this.list.concat(response.msg.data);
                        }
                    
                        // 加载状态结束
                        this.loading = false;

                        // 数据全部加载完成
                        if (this.list.length >= response.msg.total) {
                            this.finished = true;
                        }

                    }else{
                        this.$toast(response.msg);
                    }

                });
            },
        },
        mounted(){
            
        },
    }
</script>